package com.gu.utils;

import javax.servlet.http.Cookie;
import java.util.HashMap;
import java.util.Map;

public class CookieUtils {

    public static Map<String,String> cookies2Map(Cookie[] cookies) {
        Map<String,String> cookiesMap = new HashMap<>();
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                cookiesMap.put(cookie.getName(),cookie.getValue());
            }
        }


        return cookiesMap;
    }

}
